package com.sea.example.controller;

import com.sea.example.bean.CoordinateBean;
import com.sea.example.params.CoordinateListParam;
import com.sea.example.service.CoordinateService;
import com.sea.example.utils.ApiResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Description:
 * Author: hcxu
 * Time: 2024/9/5 3:21 PM
 */
@RestController
@RequestMapping("/coordinate")
@Slf4j
public class CoordinateController {
    @Autowired
    private CoordinateService coordinateService;

    @PostMapping("/addCoordinateList")
    public ApiResponse<Boolean> addCoordinateList(@RequestBody CoordinateListParam param){
        return ApiResponse.success(coordinateService.addCoordinateList(param));
    }

    @GetMapping("/getCoordinateByTime")
    public ApiResponse<CoordinateBean> getCoordinateByTime(Long time){
        return ApiResponse.success(coordinateService.getCoordinateByTime(time));
    }
}
